A gallium nitride (GaN)-based light emitting diode (LED) includes a p-type semiconductor layer providing electron holes and an n-type semiconductor layer providing electrons, having between them a P-N junction that converts electrical energy to luminous energy. When electric current passes through the LED in the forward direction, the electrons provided by the n-type semiconductor layer recombines with the electron holes in the p-type semiconductor layer, releasing energy corresponding to the band gap between the conduction band and the valence band. The energy released may either be thermal energy or light and the light may be emitted outwards.
However, when epitaxially growing the p-type semiconductor layer, growth conditions such as the growth temperature may cause a p-type dopant (e.g. magnesium) to spread to a quantum well structure, thus negatively affecting the material quality of a potential well layer in the quantum well structure. This may, in turn, lower the luminous efficiency of the LED.